package com.zhou.message.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhou.message.dao.MessageTemplateReceiver;
import com.zhou.message.mapper.MessageTemplateReceiverMapper;
import com.zhou.message.service.MessageTemplateReceiverService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lang.zhou
 * @since 2023-03-01
 */
@Service
public class MessageTemplateReceiverServiceImpl extends ServiceImpl<MessageTemplateReceiverMapper, MessageTemplateReceiver> implements MessageTemplateReceiverService {

    @Override
    public List<MessageTemplateReceiver> getTemplateReceivers(int templateId) {
        //得到消息模版的接收人
        LambdaQueryWrapper<MessageTemplateReceiver> w = new LambdaQueryWrapper<>();
        w.eq(MessageTemplateReceiver::getTemplateId,templateId);
        return list(w);
    }
}
